<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>茄子life API</title>
    <link href="{{ asset('/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('/css/bootstrap-theme.min.css') }}" rel="stylesheet" type="text/css" />
    <script src="{{ asset('/js/jquery.min.js') }}"></script>
    <script src="{{ asset('/js/bootstrap.min.js') }}"></script>
</head>
<body>
<div class="container">
    <h2>qiezilife API 使用说明</h2>
    <div class="panel panel-info">
        <div class="panel-heading"><h3 class="panel-title">
                正式环境：cp.qiezilife.com</br>
                测试环境：cptest.qiezilife.com</h3></div>
    </div>
    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingOne">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#api0" aria-expanded="true" aria-controls="collapseOne">
                        用户授权接口  <span class="glyphicon glyphicon-plus pull-right"></span>
                    </a>
                </h4>
            </div>
            <div id="api0" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
                <div class="panel-body">
                    <div class="panel panel-info">
                        <div class="panel-heading"><h3 class="panel-title">api:  DOMAIN + '/api/testing/user/init' <span class="pull-right">【GET】</span></h3></div>
                    </div>
                    <div class="panel panel-success">
                        <div class="panel-heading"><h3 class="panel-title">入参</h3></div>
                        <div class="panel-body">
                            无
                        </div>
                    </div>
                    <div class="panel panel-warning">
                        <div class="panel-heading"><h3 class="panel-title">输出</h3></div>
                        <div class="panel-body">
                            <pre>
{
  "errcode": 200,
  "msg": "SUCCESS",
  "data": {
    "uid": "4rVE9eyVBG"    *加密后的用户ID
  }
}
        	                </pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingOne">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#api1" aria-expanded="true" aria-controls="collapseOne">
                        测评列表接口  <span class="glyphicon glyphicon-plus pull-right"></span>
                    </a>
                </h4>
            </div>
            <div id="api1" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
                <div class="panel-body">
                    <div class="panel panel-info">
                        <div class="panel-heading"><h3 class="panel-title">api:  DOMAIN + '/api/testing/list' <span class="pull-right">【GET】</span></h3></div>
                    </div>
                    <div class="panel panel-success">
                        <div class="panel-heading"><h3 class="panel-title">入参</h3></div>
                        <div class="panel-body">
                            无
                        </div>
                    </div>
                    <div class="panel panel-warning">
                        <div class="panel-heading"><h3 class="panel-title">输出</h3></div>
                        <div class="panel-body">
                            <pre>
 {
  "errcode": 200,
  "msg": "SUCCESS",
  "data": {
    "list": [
      {
        "icon": "http://cptest.qiezilie.com/upload/image/icon2.png",   *icon路径
        "title": "健康测评",                                             *列表title
        "tid": "jZLVAd3JDw"                                             *加密后题目ID
      }...
    ]
  }
}
                             </pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingTwo">
                <h4 class="panel-title">
                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#api3" aria-expanded="false" aria-controls="collapseTwo">
                        测评详情接口 <span class="glyphicon glyphicon-plus pull-right"></span>
                    </a>
                </h4>
            </div>
            <div id="api3" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
                <div class="panel-body">
                    <div class="panel panel-info">
                        <div class="panel-heading"><h3 class="panel-title">api:  DOMAIN + '/api/testing/{tid}/{uid}/{try}' <span class="pull-right">【GET】</span></h3></div>
                    </div>
                    <div class="panel panel-success">
                        <div class="panel-heading"><h3 class="panel-title">入参</h3></div>
                        <div class="panel-body">
                            tid：加密后测评题目id<br />
                            uid：加密后用户id<br />
                            try：try/retry  (try表示测试，retry表示重新测试)
                        </div>
                    </div>
                    <div class="panel panel-warning">
                        <div class="panel-heading"><h3 class="panel-title">输出----用户第一次测评  or  字段为retry重新测评时，输出题目详情</h3></div>
                        <div class="panel-body">
                            <pre>
{
  "errcode": 200,
  "msg": "SUCCESS",
  "data": {
    "name": "健康测评",
    "theme": "default",
    "questionList": [
      {
        "index": "1",
        "middleVar": "0",
        "title": "性别",
        "questionType": "1",
        "options": [
          {
            "key": "男",
            "weight": 0
          },
          {
            "key": "女",
            "weight": 0
          }
        ]
      }...
    ],
    "route": true,
    "guide": {
      "note": "高血压猜测",
      "time": 6,
      "gist": "高血压依据"
    }
  }
}
        	                </pre>
                        </div>
                    </div>
                    <div class="panel panel-warning">
                        <div class="panel-heading"><h3 class="panel-title">输出----用户再次测评时，输出上次测评结果</h3></div>
                        <div class="panel-body">
                            <pre>
{
  "errcode": 200,
  "msg": "SUCCESS",
  "data": {
    "score": 12,
    "result": "您目前的综合健康评分为:12,健康状况很差",
    "attrs": [
      {
        "attr_id": 5,
        "title": "专家建议",
        "note": "健康状况很差（0-30\r\n"
      }...
    ],
    "route": false
  }
}
        	                </pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingTwo">
                <h4 class="panel-title">
                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#api4" aria-expanded="false" aria-controls="collapseTwo">
                        测评提交接口  <span class="glyphicon glyphicon-plus pull-right"></span>
                    </a>
                </h4>
            </div>
            <div id="api4" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
                <div class="panel-body">
                    <div class="panel panel-info">
                        <div class="panel-heading"><h3 class="panel-title">api:  DOMAIN + '/api/testing/submit' <span class="pull-right">【POST】</span></h3></div>
                    </div>
                    <div class="panel panel-success">
                        <div class="panel-heading"><h3 class="panel-title">入参</h3></div>
                        <div class="panel-body">
                            uid :  加密后用户id </br>
                            tid :  加密后测评题目id </br>
                            answers ： 题目答案字符串,题目之间##分割。例如"1:3:是##2:2:是##3:3:是##4:2:是"
                        </div>
                    </div>
                    <div class="panel panel-warning">
                        <div class="panel-heading"><h3 class="panel-title">输出</h3></div>
                        <div class="panel-body">
                            <pre>
{
	errcode : 200,
	msg : 'success',
	data : {
         null
        }
}
                             </pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <div class="panel panel-default">
        <div class="panel-body">

<pre>
返回数据说明
{
	errcode : 200,
	msg : 'success',
	data :{
    }
}
</pre>
            <p>
                前面标有#的参数是非必需参数 没有标记的则为必需参数
            </p>
        </div>
    </div>

</div>
</body>
</html>
